﻿using System;
using System.Collections.Generic;
using System.Text;
using XCore.Authorization;

namespace SaaS.Core.Authorization
{
    /// <summary>
    /// 菜单权限
    /// </summary>
    public class MenuPermissionProvider : AuthorizationProvider
    {
        public override void SetPermissions(IPermissionDefinitionContext context)
        {
            var permissions = context.CreatePermission(PermissionNames.Permission, "权限管理");
            permissions.CreateChildPermission(PermissionNames.Permission_User, "用户管理");
            permissions.CreateChildPermission(PermissionNames.Permission_Role, "角色管理");
            permissions.CreateChildPermission(PermissionNames.Permission_OrganizationUnit, "机构管理");
            permissions.CreateChildPermission(PermissionNames.Permission_Menu, "菜单管理");

            var site = context.CreatePermission(PermissionNames.Site, "平台管理");
            site.CreateChildPermission(PermissionNames.Site_Operation, "运营平台");
            site.CreateChildPermission(PermissionNames.Site_Order, "订单管理");
            site.CreateChildPermission(PermissionNames.Site_Project, "产品管理");
            site.CreateChildPermission(PermissionNames.Site_Tenant, "租户管理");

        }
    }
}
